package com.hjh.netty.elect.demo4;

import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.ToString;

/**
 *协议的bean对象
 * @author pyz
 *
 */
@Data
@ToString
public class Pmc350ProtocolModel {

	//固定（F9），一个字节
	private String packetHeader;
	
	//包标识，一个字节
	private String packetFlag;
	
	//设备识别码长度，一个字节（这里需要转换）
	private int deviceIdCodeLength;
	
	//设备识别码，N个字节，跟上面的deviceIdCodeLength长度对应
	String deviceIdCode;
	
	//PayLoad 部分总长度，一个字节（这里需要转换）
	private int payLoadLength;
	
	//PayLoad 校验和，一个字节
	private String payLoadVerifyTotal;
	
	//固定（F9），一个字节
	private String packetHeaderEnd;
	//上传内容，N个字节，跟上面的payLoadLength长度对应
	private String payLoad;
	
	//上传的数据
	private String uplaodData;
	
	public Pmc350ProtocolModel() {
		
	}
	
	public Pmc350ProtocolModel(String packetHeader, String packetFlag, int deviceIdCodeLength, String deviceIdCode
			,int payLoadLength, String payLoadVerifyTotal, String packetHeaderEnd, String payLoad, String uplaodData) {
		this.packetHeader = packetHeader;
		this.packetFlag = packetFlag;
		this.deviceIdCodeLength = deviceIdCodeLength;
		this.deviceIdCode = deviceIdCode;
		this.payLoadLength = payLoadLength;
		this.payLoadVerifyTotal = payLoadVerifyTotal;
		this.packetHeaderEnd = packetHeaderEnd;
		this.payLoad = payLoad;
		this.uplaodData = uplaodData;
	}
	
}
